package com.chase.springboot.controller;

import com.chase.springboot.model.Menu;
import com.chase.springboot.model.Role;
import com.chase.springboot.service.MenuService;
import com.chase.springboot.service.RoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api("菜单管理")
@RestController
public class MenuController {
    @Autowired
    private MenuService menuService;

    @ApiOperation(("添加菜单"))
    @PostMapping("/menu")
    public boolean insertUser(@RequestBody Menu menu){
        return menuService.add(menu);
    }

    @ApiOperation(("删除菜单"))
    @DeleteMapping("/menu/{id}")
    public boolean deleteUser(@PathVariable("id")Integer id){
        return menuService.deleteById(id);
    }
}
